﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace GiMessServer
{
    public static class Loger
    {
        public enum ServerLogLevel { Nothing, Subtle, Verbose };
        
        private static ServerLogLevel LogLevel = ServerLogLevel.Verbose;
        private static TextWriter Logger = Console.Out;
        
        public static void Log(string str, ServerLogLevel level)
        {
            if (Logger != null && (int)LogLevel >= (int)level)
            {
                lock(Logger)
                    Logger.Write(str);
            }
        }

        public static void LogLine(string str, ServerLogLevel level)
        {
            Log(str + "\r\n", level);
        }
    }
}
